﻿function showhint(iconid, str){
	var imgUrl='../../image/CommonImage/hint.gif';
	if (iconid != 0){
		imgUrl = '../../image/CommonImage/warning.gif';
	}
	document.write('<div id="info1" style="background:url(' + imgUrl + ') no-repeat 20px 10px;border:1px dotted #DBDDD3; background-color:#FDFFF2; margin:10px; padding:10px 10px 10px 56px; text-align: left; font-size: 12px;">');
	document.write('<span style="position:absolute ; top:20px; right:37px;"><a href="#" onclick="hidehint();"><img border="0" src="../../image/CommonImage/off.gif" alt="关闭" style="margin-left:3px;"/></a></span>');
	document.write(str + '</div><div style="clear:both;"></div>');
}
function hidehint(){
    document.getElementById('info1').style.display='none';
}

var __txtArray;
function initAutoFormStyle(){        
    var inputArry;
    inputArry = document.getElementsByTagName("input");
    for(var i=0;i<inputArry.length;i++){
        var tmpInput = null;
        tmpInput = inputArry[i];
        if(tmpInput.type == 'text' || tmpInput.type == 'password' || tmpInput.type == 'file'){
            setEvent(tmpInput);
        }
    }
    
    textArry = document.getElementsByTagName("textarea");    
    for(var i=0;i<textArry.length;i++){
        var tmpInput = null;
        tmpInput = textArry[i];
        setEvent2(tmpInput);
    }
}

function setEvent(obj){
    var newClassName = 'input_off';
    var focusClassName = 'input_on';
    if(obj.style.className != undefined){
        newClassName = obj.style.className + ' ' + newClassName;
        focusClassName =  obj.style.className + ' ' + focusClassName;
    }
    obj.className = newClassName;
    obj.onblur = function(){
        this.className = newClassName;
    }
    obj.onfocus =function(){
        this.className = focusClassName;
    }
}

function setEvent2(obj){
    var newClassName = 'input_textarea';
    var focusClassName = 'input_textarea_on';
    if(obj.style.className != undefined){
        newClassName = obj.style.className + ' ' + newClassName;
        focusClassName =  obj.style.className + ' ' + focusClassName;
    }
    obj.className = newClassName;
    obj.onblur = function(){
        this.className = newClassName;
    }
    obj.onfocus =function(){
        this.className = focusClassName;
    }
}

function openWin(url){
    newWin=window.open(url,"","scrollbars");
    if(document.all){
        newWin.moveTo(0,0);
        newWin.resizeTo(screen.width,screen.availheight);
    }
}


